<%--
  Created by IntelliJ IDEA.
  User: jimmy
  Date: 2017/7/9
  Time: 11:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"";
    pageContext.setAttribute("basePath",path);
%>
<!DOCTYPE html>
<html>
<head>
    <title>商城管理</title>
    <link href="${basePath}/css/loginstyle.css" rel="stylesheet" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body>
<div class="login">
    <h2>商城管理系统</h2>
    <div class="login-top">
        <h1>登陆页面</h1>
        <form id="loginForm" action="${basePath}/login" method="post">
            <input id="userid" name="userid" type="text" placeholder="请输入账号">
            <input id="passwd" name="passwd" type="password" placeholder="请输入密码">
        </form>
        <div class="forgot">
            <a href="#">忘记密码</a>
            <input id="login" type="submit" value="登陆" >
        </div>
    </div>

    <div class="login-bottom">
    </div>
</div>
<div class="copyright">
</div>
<div class="common-dialog-box">

</div>

<!-- jQuery Js -->
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
<script src="${basePath}/js/layer.js"></script>
<script>
    $(function () {
        $('#login').click(function () {
            if($('#userid').val() == ''){
                layer.msg("请输入账号");
                return;
            }

            if($('#passwd').val() == ''){
                layer.msg("请输入密码");
                return;
            }
            $('#loginForm').submit();
        });

        var test = '${err}';
        if(test.length > 0){
            layer.msg(test);
        }
    });
</script>
</body>
</html>
